package com.giee.tao.pojo;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;

@lombok.Data
public class Data implements Cloneable {

	public Data(Integer index, String uuid) {
		super();
		this.index = index;
		this.uuid = uuid;
	}

	private Integer index;
	private String uuid;

	public static void main(String[] args) throws CloneNotSupportedException { 
		List<Data> lista = new ArrayList<>();
		List<Data> listb = new ArrayList<>();

		for (int i = 1; i <= 150; i++) {
			Data data = new Data(i, UUID.randomUUID().toString());
			if (i <= 50) {
				lista.add(data);
			} else if (i <= 100) {
				lista.add(data);
				listb.add((Data) data.clone());
			} else {
				listb.add(data);
			}
		}

//		lista.forEach(System.out::println);
//		System.out.println("------------------");
//		listb.forEach(System.out::println);
//		System.out.println("------------------");
		listb.removeAll(lista);
		listb.forEach(System.out::println);

		System.out.println("分区------------");
		Map<Boolean, List<Data>> collect = listb.stream().collect(Collectors.partitioningBy(o -> o.getIndex() < 120));
		collect.get(true).forEach(System.out::println);

	}

}
